<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('rd_organize_user_stand', function (Blueprint $table) {
            $table->comment('用户管理站点');
            $table->unsignedBigInteger('user_id')->comment('用户ID');
            $table->bigInteger('stand_id')->comment('所属工区ID');
            $table->unsignedTinyInteger('role')->comment('角色:1=管理员,2=安全员');
            $table->tinyInteger('status')->default(1)->comment('状态:1=正常,2=停用');
            $table->authorBy();
            $table->timestamps();
            $table->string('remark')->comment('备注')->default('');
            $table->primary(['user_id', 'stand_id']);
        });
    }
    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('rd_organize_user_stand');
    }
};